﻿@model LunchList.ViewModels.HomeViewModel
@{
    ViewBag.Title = "Home Page";
}

<div class="jumbotron">
    <h1>Active Directory Group Lunch Sign Up</h1>
    <p class="lead">This is where you can sign up for lunch with coworkers</p>
</div>
@using (Ajax.BeginForm("GetGuestLists", "Home", new AjaxOptions { UpdateTargetId = "GuestListTable", InsertionMode = InsertionMode.Replace, HttpMethod = "GET" }))
{
  <div class="container">
    <table class="table table-striped">
        <tr>
            <td>
                @Html.Label("LunchDate")
            </td>
            <td>
                @Html.DropDownListFor(n => n.SelectedDate, Model.AvailableDates, "Please select", new
                                           {
                                               id= "ddlDates",
                                               @class = "dateInput",
                                               data_date_format = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern.ToLower()
                                           })
            </td>
            <td>
                <input class="dateInput" type="submit" value="View Guests"  />            
            </td>
        </tr>
    </table>
</div>   
}

<div id="GuestListTable">
    @{  Html.RenderAction("GetGuestLists", "Home", Model); }
</div>




